<?php

class CErrorException extends Exception {
	var $SourceError;
	
	function __construct($error) {
		if (is_numeric($error->Code))
			parent::__construct((string) $error->Message, (integer) $error->Code);
		else
			parent::__construct((string) $error->Message);
		$this->SourceError = $error;
	}
}

class _CError extends CObject {
	function Raise() {
		throw new CErrorException($this);
	}
}

?>